home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / wb / huntwin2_1.lha / huntwindows.s < prev   
Text File  |  1993-03-15  |  26KB  |  1,260 lines

  1.             output    work:huntwindows
  2.             OPT o+,ow-
  3.             ;no includes - i use them all preassembled!
  4.  
  5.             ;.... nearly all ....
  6.  
  7.             incdir    "sys:devpac/include/"
  8.             include "workbench/startup.i"
  9.             include "workbench/workbench.i"
  10.             include    "libraries/commodities.i"
  11.     
  12. ;WHERE ARE THE INCLUDES FOR THIS??????
  13. _LVOFreeDiskObject    = -90
  14. _LVOGetDiskObject    = -78
  15. _LVOFindToolType    = -96
  16.  
  17.             ;Some helpful macros
  18. CALL            macro
  19.             jsr    _LVO\1(a6)
  20.             endm
  21. Push            macro
  22.             movem.l    \1,-(sp)
  23.             endm
  24. Pull            macro
  25.             movem.l    (sp)+,\1
  26.             endm
  27. RSave            macro
  28.             movem.l    a0-a6/d0-d7,-(sp)
  29.             endm
  30. RLoad            macro
  31.             movem.l    (sp)+,a0-a6/d0-d7
  32.             endm
  33.  
  34. MaxScreens        equ    64    ;Maximum of 64 Screens - who has more?
  35. ScreenMemSize        equ    MaxScreens*8    
  36.  
  37.         ;Bits for Communication
  38. SignalWindow        equ    0
  39. SignalScreen        equ    1
  40.  
  41.             move.l    $04,a6
  42.             move.l    #AllocLength,d0
  43.             move.l    #MEMF_CLEAR,d1
  44.             CALL    AllocMem
  45.             move.l    d0,a4
  46.             beq    EndeRaus
  47.             move.l    d0,RememberA4
  48.  
  49.             lea    DosName(pc),a1
  50.             moveq.l    #36,d0        ;2.0 Only
  51.             CALL    OpenLibrary    
  52.             move.l    d0,DosBase(a4)
  53.             beq    Error2
  54.  
  55.  
  56.  
  57.             lea    GadName(pc),a1
  58.             moveq.l    #0,d0
  59.             CALL    OpenLibrary
  60.             move.l    d0,GadBase(a4)
  61.             beq    Error2
  62.  
  63.             lea    CommName(pc),a1
  64.             moveq.l    #0,d0
  65.             CALL    OpenLibrary
  66.             move.l    d0,CommBase(a4)
  67.             beq    Error2
  68.  
  69.             move.l    ThisTask(a6),a1
  70.             tst.l    pr_CLI(a1)
  71.             bne    CliStart
  72.             lea    pr_MsgPort(a1),a2
  73.             move.l    a2,a0
  74.             CALL    WaitPort
  75.             move.l    a2,a0
  76.             CALL    GetMsg
  77.             move.l    d0,WBMessage(a4)
  78.             move.l    d0,a3
  79.         
  80.             move.l    $04,a6
  81.             lea    IconName(pc),a1
  82.             moveq.l    #33,d0
  83.             CALL    OpenLibrary
  84.             move.l    d0,IconBase(a4)
  85.             beq    Error2
  86.  
  87.             move.l    sm_ArgList(a3),d0
  88.             beq.s    SkipReadArgs
  89.             move.l    d0,a0
  90.             move.l    a0,-(sp)
  91.             move.l    wa_Lock(a0),d1
  92.             move.l    DosBase(a4),a6
  93.             CALL    CurrentDir
  94.             move.l    (sp)+,a0
  95.  
  96.             move.l    IconBase(a4),a6
  97.             move.l    wa_Name(a0),a0
  98.             CALL    GetDiskObject
  99.             move.l    d0,DObject(a4)
  100.             beq    Error2
  101.  
  102.             move.l    #SIGBREAKF_CTRL_C,SignalMask(a4)
  103.  
  104.             lea    WBTemplate(pc),a3
  105.  
  106.             move.l    d0,a0
  107.             move.l    do_ToolTypes(a0),a0
  108.             
  109. GetEmLoop        move.l    (a3)+,a1
  110.             move.l    a1,d0
  111.             beq.s    FreeDobj
  112.             move.l    a0,-(sp)
  113.             CALL    FindToolType
  114.             move.l    (sp)+,a0
  115.             move.l    (a3)+,a2
  116.             add.l    a4,a2
  117.             move.l    d0,(a2)
  118.             bra.s    GetEmLoop
  119.  
  120. FreeDobj        move.l    DObject(a4),a0
  121.             CALL    FreeDiskObject
  122.             bra.s    SkipReadArgs
  123.  
  124. CliStart        move.l    DosBase(a4),a6
  125.  
  126.             move.l    #Template,d1
  127.             lea    TemplateArray(a4),a0
  128.             move.l    a0,d2
  129.             moveq.l    #0,d3
  130.             CALL    ReadArgs    ;Get options
  131.             tst.l    d0
  132.             beq    Error3
  133.             move.l    d0,Args(a4)
  134.  
  135. SkipReadArgs        move.l    $04,a6
  136.             lea    intuition(pc),a1
  137.             moveq.l    #36,d0
  138.             CALL    OpenLibrary
  139.             move.l    d0,IntBase(a4)
  140.             beq    Error2
  141.             lea    GraphicsName(pc),a1
  142.             moveq.l    #36,d0
  143.             CALL    OpenLibrary
  144.             move.l    d0,GraphicsBase(a4)
  145.             beq    Error2
  146.  
  147.             tst.l    TempHADJ(a4)
  148.             beq    GotIt1
  149.             move.l    TempHADJ(a4),a0
  150.             bsr    GetNexta0
  151.             clr.l    TempHADJ(a4)
  152.             cmp.b    #"l",d0
  153.             beq.s    GotIt1
  154.             add.l    #1,TempHADJ(a4)
  155.             cmp.b    #"r",d0
  156.             beq.s    GotIt1
  157.             add.l    #1,TempHADJ(a4)
  158.             cmp.b    #"c",d0
  159.             beq.s    GotIt1
  160.             add.l    #1,TempHADJ(a4)
  161.  
  162. GotIt1            tst.l    TempVADJ(a4)
  163.             beq    GotIt2
  164.             move.l    TempVADJ(a4),a0
  165.             bsr    GetNexta0
  166.             clr.l    TempVADJ(a4)
  167.             cmp.b    #"t",d0
  168.             beq.s    GotIt2
  169.             add.l    #1,TempVADJ(a4)
  170.             cmp.b    #"b",d0
  171.             beq.s    GotIt2
  172.             add.l    #1,TempVADJ(a4)
  173.             cmp.b    #"c",d0
  174.             beq.s    GotIt2
  175.             add.l    #1,TempVADJ(a4)
  176.  
  177. GotIt2            move.l    $04,a6
  178.             CALL    CreateMsgPort
  179.             move.l    d0,BrokerPort
  180.             move.l    d0,MyPort(a4)
  181.             move.l    d0,a0
  182.             move.b    MP_SIGBIT(a0),d0
  183.             move.l    SignalMask(a4),d1        ;Enter signal into
  184.             bset    d0,d1            ;mask for waiting
  185.             move.l    d1,SignalMask(a4)
  186.  
  187.             move.l    CommBase(a4),a6
  188.             lea    MyNewBroker(pc),a0
  189.             clr.l    d0
  190.             CALL    CxBroker
  191.             tst.l    d0
  192.             beq    QuitPrg
  193.             move.l    d0,Broker(a4)
  194.  
  195.             move.l    d0,a0
  196.             moveq.l    #1,d0
  197.             CALL    ActivateCxObj
  198.  
  199.             move.l    $04,a6            ;Build interrupt-server
  200.             sub.l    a1,a1
  201.             jsr    _LVOFindTask(a6)
  202.             move.l    d0,OwnTask(a4)
  203.  
  204.                     moveq   #-1,d0            ;A Signal for telling
  205.                     jsr     _LVOAllocSignal(a6)    ;our task that sth happened
  206.                     tst.l   d0
  207.                     bmi     Error2
  208.                     move.l  d0,Signal(a4)
  209.             move.l    SignalMask(a4),d1
  210.                     bset    d0,d1
  211.                     move.l    d1,SignalMask(a4)
  212.  
  213.             lea    MyInterrupt(a4),a1
  214.             move.l    #Interrupt3,IS_CODE(a1)
  215.             clr.l    IS_DATA(a1)
  216.             move.b    #NT_INTERRUPT,LN_TYPE(a1)
  217.             move.b    #0,LN_PRI(a1)
  218.             move.l    #HandlerName,LN_NAME(a1)
  219.             move.l    #5,d0    ;INTB_VERTB
  220.             jsr    _LVOAddIntServer(a6)
  221.  
  222. WaitOn            tst.w    QuitMe(a4)
  223.             bne    QuitPrg
  224.  
  225.             tst.l    TempCXPOPUP(a4)
  226.             beq.s    NoPop
  227.             bsr    OpenGUI
  228.             clr.l    TempCXPOPUP(a4)
  229. NoPop            move.l    $04,a6
  230.             move.l    SignalMask(a4),d0        ;Wait for Port and Break
  231.             CALL    Wait
  232.             btst    #SIGBREAKB_CTRL_C,d0    ;This means quit
  233.             bne    QuitPrg
  234.             move.l    Signal(a4),d1
  235.             btst    d1,d0            ;Signal from Interrupt?
  236.             beq.s    TryNextMsg
  237.  
  238.             tst.w    DisableHW(a4)
  239.             bne.s    TryNextMsg        ;Do nothing
  240.  
  241.             move.l    IntBase(a4),a0
  242.             btst    #SignalWindow,What(a4)
  243.             beq.s    NoWindowStuff
  244.             
  245.             move.l    ib_ActiveWindow(a0),a0
  246.             bsr    DoYourJob
  247.             bclr    #SignalWindow,What(a4)
  248.  
  249. NoWindowStuff        btst    #SignalScreen,What(a4)
  250.             beq.s    TryNextMsg
  251.             move.l    IntBase(a4),a0
  252.             move.l    ib_FirstScreen(a0),a0
  253.             bsr    AdjustScreen
  254.             bclr    #SignalScreen,What(a4)
  255.  
  256. TryNextMsg        move.l    MyPort(a4),a0        ;Get the message awaiting
  257.             CALL    GetMsg
  258.             tst.l    d0
  259.             bne.s    GotMsg
  260.             bsr    CheckGUI
  261.             bra    WaitOn
  262.  
  263. GotMsg            move.l    d0,a3
  264.             move.l    d0,a0
  265.             move.l    CommBase(a4),a6
  266.             CALL    CxMsgType
  267.             move.l    d0,d6
  268.             move.l    a3,a0
  269.             CALL    CxMsgID
  270.             move.l    d0,d5
  271.             move.l    a3,a1
  272.             move.l    $04,a6
  273.             CALL    ReplyMsg
  274.             cmp.w    #CXM_IEVENT,d6
  275.             bne.s    OtherCommand
  276.             bsr    OpenGUI
  277.  
  278. OtherCommand        cmp.w    #CXM_COMMAND,d6
  279.             bne    WaitOn
  280.  
  281.             cmp.w    #CXCMD_DISABLE,d5
  282.             bne.s    OtherI1
  283.             move.w    #1,DisableHW(a4)
  284.  
  285. OtherI1            cmp.w    #CXCMD_ENABLE,d5
  286.             bne.s    OtherI2
  287.             clr.w    DisableHW(a4)
  288.  
  289. OtherI2            cmp.w    #CXCMD_UNIQUE,d5
  290.             beq.s    OtherII
  291.             cmp.w    #CXCMD_APPEAR,d5
  292.             bne.s    OtherI3
  293. OtherII            bsr    OpenGUI
  294.  
  295. OtherI3            cmp.w    #CXCMD_DISAPPEAR,d5
  296.             bne.s    OtherI4
  297.             bsr    CloseGUI
  298.  
  299. OtherI4            cmp.w    #CXCMD_KILL,d5
  300.             beq    QuitPrg
  301.  
  302.             bra    TryNextMsg
  303.  
  304. Error3            lea    Text1(pc),a0        ;Seems there is an error
  305.             bsr    PrintText        ;in the given arguments
  306.             bra.s    QuitPrg
  307.  
  308. Error2            lea    Text2(pc),a0        ;Tell the user something
  309.             bsr    PrintText        ;went wrong with the libs
  310.             bra.s    QuitPrg
  311.  
  312. QuitPrg            bsr    CloseGUI
  313.             move.l    $04,a6    
  314.             move.l    #5,d0
  315.             lea    MyInterrupt(a4),a1
  316.             tst.l    IS_CODE(a1)
  317.             beq.s    NoHandler
  318.             CALL    RemIntServer        ;Remove the Interrupt-Server
  319.  
  320. NoHandler        move.l    Signal(a4),d0        ;Free the signal
  321.             beq.s    DontFreeS
  322.                     CALL    FreeSignal
  323.  
  324. DontFreeS        tst.l    Args(a4)
  325.             beq.s    HmmNoArgs
  326.             move.l    DosBase(a4),a6
  327.             move.l    Args(a4),d1
  328.             CALL    FreeArgs
  329.  
  330. HmmNoArgs        tst.l    Broker(a4)
  331.             beq.s    NoCX
  332.             move.l    CommBase(a4),a6
  333.             move.l    Broker(a4),a0
  334.             CALL    DeleteCxObjAll
  335.  
  336. NoCX            move.l    $04,a6
  337.             tst.l    MyPort(a4)
  338.             beq.s    NoPort
  339. ReplyAllLeft        move.l    MyPort(a4),a0
  340.             CALL    GetMsg
  341.             tst.l    d0
  342.             beq.s    NoMsgLeft
  343.             move.l    d0,a1
  344.             CALL    ReplyMsg
  345.             bra.s    ReplyAllLeft
  346. NoMsgLeft        move.l    MyPort(a4),a0
  347.             CALL    DeleteMsgPort        ;and free it
  348.  
  349. NoPort            tst.l    IntBase(a4)        ;Close librarys
  350.             beq.s    ErrorX2
  351.             move.l    IntBase(a4),a1
  352.             CALL    CloseLibrary
  353. ErrorX2            tst.l    GraphicsBase(a4)
  354.             beq.s    Error
  355.             move.l    GraphicsBase(a4),a1
  356.             CALL    CloseLibrary
  357.  
  358. Error            move.l    $0004.w,a6
  359.             tst.l    WBMessage(a4)
  360.             beq.s    NoWB
  361.             move.l    WBMessage(a4),a1
  362.             CALL    ReplyMsg
  363.  
  364. NoWB            move.l    $04,a6
  365.             move.l    IconBase(a4),d0
  366.             beq.s    NoIconLib
  367.             move.l    d0,a1
  368.             CALL    CloseLibrary
  369.             
  370. NoIconLib        tst.l    CommBase(a4)
  371.             beq.s    NoCommLib
  372.             move.l    CommBase(a4),a1
  373.             CALL    CloseLibrary
  374.  
  375. NoCommLib        tst.l    GadBase(a4)
  376.             beq.s    OnlyDOS
  377.             move.l    GadBase(a4),a1
  378.             CALL    CloseLibrary
  379.  
  380. OnlyDOS            tst.l    DosBase(a4)
  381.             beq.s    FreeOnly
  382.             move.l    DosBase(a4),a1
  383.             CALL    CloseLibrary
  384.  
  385. FreeOnly        move.l    a4,a1
  386.             move.l    #AllocLength,d0
  387.             CALL    FreeMem            
  388.  
  389. EndeRaus        moveq.l    #0,d0
  390.             rts
  391.  
  392.             ;Subroutine to print a text to stdout
  393. PrintText        Push    d0-d4/a0-a1/a6
  394.             move.l    a0,a1
  395.             moveq.l    #0,d0
  396. TestLen            tst.b    (a1)+
  397.             beq.s    LaengeOk
  398.             addq    #1,d0
  399.             bra.s    TestLen
  400. LaengeOk        move.l    DosBase(a4),a6
  401.             move.l    a0,d2
  402.             move.l    d0,d3
  403.             CALL    Output
  404.             move.l    d0,d1
  405.             beq.s    SkipWrite
  406.             move.l    a0,d2
  407.             move.l    d0,d3
  408.             CALL    Write
  409. SkipWrite        Pull    d0-d4/a0-a1/a6
  410.             rts
  411.  
  412.             ;MainPart: does the scrolling if necessary
  413.             ;Gets window in a0
  414. DoYourJob        RSave
  415.             move.l    a0,d0        ;No Window - let it be!
  416.             beq    LeaveIt
  417.             move.l    a0,a5
  418.  
  419.             move.l    wd_WScreen(a5),a0
  420.             ;cmp.l    FirstSc(a4),a0
  421.             ;bne.s    NoInterest
  422.             move.l    a5,d0
  423.             bsr    RememberWindow
  424. NoInterest        move.l    a0,d0        ;Screen not valid? - let it be!
  425.             beq    LeaveIt
  426.             move.l    a0,a3
  427.             tst.l    TempWBOnly(a4)    ;Only work on WBench Screen?
  428.             beq.s    NoMatter
  429.             move.w    sc_Flags(a3),d0
  430.             and.w    #$f,d0
  431.             cmp.w    #WBENCHSCREEN,d0
  432.             bne    LeaveIt
  433.  
  434. NoMatter        move.l    GraphicsBase(a4),a6        ;Get the visible size
  435.             lea    sc_ViewPort(a3),a0    ;of the screen to
  436.             CALL    GetVPModeID        ;determine when a window
  437.             move.l    d0,d2            ;is visible and when not
  438.             lea    DisplayInfer(a4),a1
  439.             move.l    #dim_SIZEOF,d0
  440.             move.l    #DTAG_DIMS,d1
  441.             sub.l    a0,a0
  442.             CALL    GetDisplayInfoData
  443.             lea    DisplayInfer(a4),a0
  444.             lea    dim_TxtOScan(a0),a0
  445.             move.w    ra_MaxX(a0),d0
  446.             sub.w    ra_MinX(a0),d0
  447.             addq    #1,d0
  448.             move.w    d0,VisualX(a4)
  449.  
  450.             move.w    ra_MaxY(a0),d0
  451.             sub.w    ra_MinY(a0),d0
  452.             addq    #1,d0
  453.             move.w    d0,VisualY(a4)
  454.  
  455.             move.l    a3,a0
  456.             move.l    IntBase(a4),a6
  457.             tst.l    TempSFront(a4)        ;do we want screentofront?
  458.             beq.s    NoFront
  459.             CALL    ScreenToFront
  460.             bset    #SignalScreen,What(a4)    ;ScreenChange!
  461.  
  462. NoFront            move.l    wd_Flags(a5),d0
  463.             and.l    #WFLG_BACKDROP,d0
  464.             bne    LeaveIt        ;Not with backdrops!
  465.  
  466.             tst.l    TempWFront(a4)        ;do we WindowToFront() ?
  467.             beq.s    NoFront2
  468.             move.l    a5,a0
  469.             move.l    wd_Flags(a0),d0
  470.             and.l    #WBENCHWINDOW,d0    ;does not work - but why?
  471.             bne.s    NoFront2
  472.             CALL    WindowToFront
  473.  
  474. NoFront2        tst.l    TempMove(a4)
  475.             beq    LeaveIt
  476.             move.l    wd_WScreen(a5),a0    ;If the screen is smaller
  477.             move.w    sc_Width(a0),d0        ;that the visible size
  478.             cmp.w    VisualX(a4),d0        ;in any way, we use the
  479.             bcc.s    NoMat1            ;original screen-size
  480.             move.w    sc_Width(a0),VisualX(a4)
  481. NoMat1            move.w    sc_Height(a0),d0
  482.             cmp.w    VisualY(a4),d0
  483.             bcc.s    NoMat2
  484.             move.w    sc_Height(a0),VisualX(a4)
  485.             
  486.  
  487. NoMat2            moveq.l    #0,d7
  488.             moveq.l    #0,d6
  489.             moveq.l    #0,d0
  490.             moveq.l    #0,d2
  491.             move.w    wd_LeftEdge(a5),d0
  492.             add.w    wd_Width(a5),d0
  493.             move.w    sc_LeftEdge(a0),d2
  494.             neg.w    d2
  495.             add.w    VisualX(a4),d2
  496.             sub.w    d0,d2
  497.             beq.s    SeemsOk2
  498.             bpl.s    SeemsOk
  499.             move.w    d2,d7        ;MOVEX!
  500.             ext.l    d7
  501. SeemsOk            move.w    wd_LeftEdge(a5),d0
  502.             move.w    sc_LeftEdge(a0),d2
  503.             neg.w    d2
  504.             sub.w    d2,d0
  505.             bne.s    TestAgain
  506.             moveq.l    #0,d7
  507. TestAgain        bpl.s    SeemsOk2
  508.             move.w    d0,d7        ;MOVEX!    - Prefer Leftedge
  509.             ext.l    d7
  510.             neg.l    d7
  511. SeemsOk2        move.w    wd_TopEdge(a5),d0
  512.             move.w    sc_TopEdge(a0),d2
  513.             neg.w    d2
  514.             sub.w    d2,d0
  515.             beq.s    SeemsOk4
  516.             bpl.s    SeemsOk3
  517.             move.w    d0,d6
  518.             ext.l    d6        ;MOVEY!
  519.             neg.l    d6
  520. SeemsOk3        move.w    wd_TopEdge(a5),d0
  521.             add.w    wd_Height(a5),d0
  522.             move.w    sc_TopEdge(a0),d2
  523.             neg.w    d2
  524.             add.w    VisualY(a4),d2
  525.             sub.w    d0,d2
  526.             bne.s    TestAgain2
  527.             moveq.l    #0,d6
  528. TestAgain2        bpl.s    SeemsOk4
  529.             move.w    d2,d6        ;MOVEY! - Prefer bottom
  530.             ext.l    d6
  531. SeemsOk4        tst.l    TempAlways(a4)
  532.             bne.s    DOOO
  533.             tst.l    d7
  534.             bne.s    DOOO
  535.             tst.l    d6
  536.             beq    LeaveIt
  537.  
  538. DOOO            move.l    d7,d0
  539.             tst.l    TempAlways(a4)
  540.             bne.s    DoAlways1
  541.             tst.l    d0
  542.             beq.s    NoMoveAny1
  543. DoAlways1        cmp.l    #2,TempHADJ(a4)
  544.             bne.s    NoCentering1
  545.  
  546.             moveq.l    #0,d0
  547.             move.w    wd_Width(a5),d0
  548.             lsr.w    #1,d0
  549.             add.w    wd_LeftEdge(a5),d0
  550.             moveq.l    #0,d2
  551.             move.w    VisualX(a4),d2
  552.             lsr.w    #1,d2
  553.             move.w    sc_LeftEdge(a0),d3
  554.             neg.w    d3
  555.             add.w    d3,d2
  556.             sub.w    d0,d2
  557.             move.l    d2,d0
  558.             ext.l    d0
  559.             bra    NoMoveAny1
  560.             
  561. NoCentering1        tst.l    TempHADJ(a4)
  562.             bne.s    RightAdj
  563.             moveq.l    #0,d0
  564.             move.w    wd_LeftEdge(a5),d0
  565.             add.w    sc_LeftEdge(a0),d0
  566.             neg.w    d0
  567.             ext.l    d0
  568.             bra.s    NoMoveAny1
  569.  
  570. RightAdj        cmp.l    #1,TempHADJ(a4)
  571.             bne.s    NoMoveAny1
  572.             move.w    wd_LeftEdge(a5),d0
  573.             add.w    wd_Width(a5),d0
  574.             move.w    sc_LeftEdge(a0),d2
  575.             neg.w    d2
  576.             add.w    VisualX(a4),d2
  577.             sub.w    d0,d2
  578.             move.l    d2,d0
  579.             ext.l    d0
  580.  
  581. NoMoveAny1        move.l    d6,d1
  582.             tst.l    TempAlways(a4)
  583.             bne.s    DoAlways2
  584.             tst.l    d1
  585.             beq.s    NoMoveAny2
  586. DoAlways2        cmp.l    #2,TempVADJ(a4)
  587.             bne.s    NoCentering2
  588.  
  589.             moveq.l    #0,d1
  590.             move.w    wd_Height(a5),d1
  591.             lsr.w    #1,d1
  592.             add.w    wd_TopEdge(a5),d1
  593.             moveq.l    #0,d2
  594.             move.w    VisualY(a4),d2
  595.             lsr.w    #1,d2
  596.             move.w    sc_TopEdge(a0),d3
  597.             neg.w    d3
  598.             add.w    d3,d2
  599.             sub.w    d1,d2
  600.             move.l    d2,d1
  601.             ext.l    d1
  602.             bra    NoMoveAny2
  603.  
  604. NoCentering2        tst.l    TempVADJ(a4)
  605.             bne.s    BotAdj
  606.             moveq.l    #0,d1
  607.             move.w    wd_TopEdge(a5),d1
  608.             add.w    sc_TopEdge(a0),d1
  609.             neg.w    d1
  610.             ext.l    d1
  611.             bra.s    NoMoveAny2
  612.  
  613. BotAdj            cmp.l    #1,TempVADJ(a4)
  614.             bne.s    NoMoveAny2
  615.             move.w    wd_TopEdge(a5),d1
  616.             add.w    wd_Height(a5),d1
  617.             move.w    sc_TopEdge(a0),d2
  618.             neg.w    d2
  619.             add.w    VisualY(a4),d2
  620.             sub.w    d1,d2
  621.             move.l    d2,d1
  622.             ext.l    d1
  623.  
  624. NoMoveAny2        CALL    MoveScreen
  625. LeaveIt            RLoad
  626.             rts
  627.  
  628.             ;ScreenID in a0
  629. AdjustScreen        RSave
  630.             tst.l    TempPDef(a4)    ;Enter FirstScreen as Default
  631.                         ;PublicScreen ?
  632.             beq.s    Skip_NoPub
  633.             bsr    GetPubFromID
  634.             move.l    a0,d0
  635.             beq.s    Skip_NoPub
  636.             move.l    IntBase(a4),a6
  637.             CALL    SetDefaultPubScreen
  638.  
  639. Skip_NoPub        tst.l    TempRemWin(a4)    ;Activate a Window on the new
  640.                         ;Screen?
  641.             beq.s    SkipActive
  642.             bsr    GetScreenWindow
  643.             tst.l    d0
  644.             beq.s    SkipActive
  645.  
  646.             move.l    d0,a0
  647.             move.l    IntBase(a4),a6
  648.             CALL    ActivateWindow
  649. SkipActive        RLoad
  650.             rts
  651.  
  652.         ;a0=Screen         Back:d0=Window
  653. GetScreenWindow        Push    a1/d1
  654.             lea    ScreenMem(a4),a1
  655.             move.w    #MaxScreens-1,d1
  656. ScreenFindLoop        cmp.l    (a1),a0
  657.             beq.s    FoundScreen
  658.             lea    8(a1),a1
  659.             dbf    d1,ScreenFindLoop
  660. FoundScreen        move.l    4(a1),d0
  661.             bsr    TestWindowOnScreen
  662.             Pull    a1/d1
  663.             rts
  664.  
  665.         ;a0=Screen d0=Window
  666. RememberWindow        Push    a1-a3/a6/d1
  667.             move.l    IntBase(a4),a6
  668.             lea    ScreenMem(a4),a1
  669.             move.w    #MaxScreens-1,d1
  670. ScreenFindLoop2        tst.l    (a1)
  671.             beq.s    FoundEmpty
  672.             move.l    (a1),a2
  673.             cmp.l    a0,a2
  674.             beq.s    FoundEmpty    ;because Identical
  675.  
  676.             move.l    ib_FirstScreen(a6),a3
  677. CheckAllScreens        cmp.l    a3,a2
  678.             beq    ScreenValid
  679.             move.l    sc_NextScreen(a3),a3
  680.             cmp.l    #0,a3
  681.             bne.s    CheckAllScreens
  682.             bra.s    FoundEmpty    ;because Entry is invalid
  683.  
  684. ScreenValid        lea    8(a1),a1
  685.             dbf    d1,ScreenFindLoop2
  686.             ;Reaching this Point our List is full of valid
  687.             ;Screens - not the best thing, but we simply ignore...
  688.             bra.s    IgnoreOver
  689. FoundEmpty        move.l    a0,(a1)
  690.             move.l    d0,4(a1)
  691. IgnoreOver        Pull    a1-a3/a6/d1
  692.             rts
  693.  
  694.         ;d0=Window , a0=Screen    =Back: d0=0 no window
  695. TestWindowOnScreen    tst.l    d0
  696.             beq.s    NotWindow
  697.             move.l    sc_FirstWindow(a0),a1
  698. WindowListOn        cmp.l    d0,a1
  699.             beq.s    WindowIsOK
  700.             move.l    wd_NextWindow(a1),a1
  701.             cmp.l    #0,a1
  702.             bne.s    WindowListOn
  703. NotWindow        clr.l    d0
  704.             rts
  705. WindowIsOK        move.l    a1,d0
  706.             rts
  707.  
  708.             ;ScreenID in a0    ;Return a0=PubScreenName or Zero
  709. GetPubFromID        Push    d0/a3/a6
  710.             move.l    a0,a3
  711.             move.l    IntBase(a4),a6
  712.             CALL    LockPubScreenList
  713.  
  714. CarryListOn        move.l    d0,a0
  715.             cmp.l    psn_Screen(a0),a3
  716.             beq.s    ScreenFound
  717.             move.l    LN_SUCC(a0),d0
  718.             bne.s    CarryListOn
  719.             sub.l    a0,a0
  720.             bra.s    ENDPS
  721.  
  722. ScreenFound        move.l    LN_NAME(a0),a0
  723. ENDPS            move.l    a0,-(sp)
  724.             CALL    UnlockPubScreenList
  725.             move.l    (sp)+,a0
  726.             Pull    d0/a3/a6
  727.             rts
  728.  
  729. Interrupt3        RSave
  730.             move.l    RememberA4,a4
  731.             move.l    IntBase(a4),a0
  732.             move.l    Active(a4),d0
  733.             cmp.l    ib_ActiveWindow(a0),d0        ;New ActiveWindow?
  734.             beq.s    DoNothing
  735.             move.l    ib_ActiveWindow(a0),Active(a4)
  736.  
  737.             bsr    SignalMyself
  738.  
  739.             bset    #SignalWindow,What(a4)
  740.             
  741. DoNothing        move.l    IntBase(a4),a0
  742.             move.l    FirstSc(a4),d0
  743.             cmp.l    ib_FirstScreen(a0),d0        ;New FirstScreen?
  744.             beq.s    DoNothing2
  745.             move.l    ib_FirstScreen(a0),FirstSc(a4)
  746.  
  747.             bsr    SignalMyself
  748.  
  749.             bset    #SignalScreen,What(a4)
  750.  
  751. DoNothing2        RLoad
  752.             moveq.l    #0,d0
  753.             rts
  754.  
  755. SignalMyself        move.l  $04,a6
  756.             move.l  OwnTask(a4),a1
  757.             move.l  Signal(a4),d1        ;send a signal to move Screen
  758.             moveq.l    #0,d0
  759.             bset    d1,d0
  760.             CALL    Signal
  761.             rts
  762.  
  763. OpenGUI            RSave
  764.             tst.w    GUIOpened(a4)
  765.             bne    OpenNoGUI
  766.             move.l    IntBase(a4),a6
  767.             sub.l    a0,a0
  768.             CALL    LockPubScreen
  769.             move.l    d0,PublicScreen(a4)
  770.             move.l    d0,StorePublicScreen
  771.  
  772.             move.l    d0,a0
  773.             lea    sc_RastPort(a0),a1
  774.             move.l    a1,PublicRastport(a4)
  775.             lea    TagList(pc),a1
  776.             move.l    GadBase(a4),a6
  777.             CALL    GetVisualInfoA
  778.             move.l    d0,MyVisual(a4)
  779.             lea    MyNewGadget(a4),a3
  780.             move.l    d0,gng_VisualInfo(a3)
  781.  
  782.             lea    GadgetList(a4),a0
  783.             CALL    CreateContext
  784.             move.l    d0,Gadget0(a4)
  785.  
  786.             move.l    GraphicsBase(a4),a6
  787.             move.l    PublicRastport(a4),a1
  788.             lea    GUI_Text7(pc),a0
  789.             moveq.l    #GUI_Text9-GUI_Text8-1,d0
  790.             CALL    TextLength
  791.             move.w    d0,RemLen(a4)
  792.  
  793.             move.l    PublicRastport(a4),a1
  794.             lea    GUI_Text9(pc),a0
  795.             moveq.l    #GUI_Text11-GUI_Text10-1,d0
  796.             CALL    TextLength
  797.             add.w    #16,d0
  798.             move.w    d0,RemLen2(a4)
  799.  
  800.             move.l    PublicRastport(a4),a1
  801.             lea    GUI_Text5(pc),a0
  802.             moveq.l    #GUI_Text6-GUI_Text5-1,d0
  803.             CALL    TextLength
  804.             move.l    d0,d5    ;TextLen
  805.             add    #54,d0
  806.  
  807.             add.w    RemLen(a4),d0
  808.             move.l    d0,StoreInnerWidth
  809.             
  810.             move.l    PublicScreen(a4),a0
  811.             moveq.l    #6,d0
  812.             add.b    sc_WBorLeft(a0),d0
  813.             add.w    d0,d5    ;+ Border/Constant
  814.             add.w    #42,d5
  815.             move.w    d0,gng_LeftEdge(a3)
  816.  
  817.             move.w    #26,gng_Width(a3)
  818.  
  819.             move.l    sc_Font(a0),a1
  820.             move.l    a1,gng_TextAttr(a3)
  821.             moveq.l    #1,d0
  822.             add.b    sc_WBorTop(a0),d0
  823.             move.w    ta_YSize(a1),d6
  824.             add.w    #6,d6
  825.             move.w    d0,gng_TopEdge(a3)
  826.  
  827.             move.w    ta_YSize(a1),d0
  828.             move.w    d0,RemFontSize(a4)
  829.             move.l    d0,d1
  830.             mulu    #7,d1
  831.             add    #46,d1
  832.             move.l    d1,StoreInnerHeight
  833.             
  834.             addq.l    #6,d0
  835.             move.w    d0,gng_Height(a3)
  836.  
  837.             move.l    #PLACETEXT_RIGHT,gng_Flags(a3)
  838.  
  839.             move.w    #00,gng_GadgetID(a3)
  840.             move.l    Gadget0(a4),a5
  841.             lea    GUI_Text1(pc),a2
  842.             move.l    GadBase(a4),a6
  843.  
  844.  
  845.             move.w    #6,d4    ;Loop
  846.  
  847. PlaceGadgets        move.l    a2,gng_GadgetText(a3)
  848.  
  849. NextStringEnd        tst.b    (a2)+
  850.             bne.s    NextStringEnd
  851.  
  852.             lea    TemplateArray(a4),a0
  853.             move.w    gng_GadgetID(a3),d0
  854.             lsl.w    #2,d0
  855.             move.l    (a0,d0.w),CheckedPlace
  856.  
  857.             add.w    #1,gng_GadgetID(a3)
  858.             add.w    d6,gng_TopEdge(a3)
  859.             
  860.             Push    a2
  861.             moveq.l    #CHECKBOX_KIND,d0
  862.             move.l    a5,a0        ;Previous
  863.             move.l    a3,a1
  864.             lea    GadgetTagList(pc),a2
  865.             CALL    CreateGadgetA
  866.             move.l    d0,a5
  867.             Pull    a2
  868.         
  869.             dbf    d4,PlaceGadgets
  870.             move.w    gng_TopEdge(a3),RemEdge(a4)
  871.  
  872.             lea    CycleList(pc),a0
  873.             move.l    a0,CycleStore
  874.  
  875.             move.w    d5,gng_LeftEdge(a3)
  876.  
  877.             move.w    RemLen(a4),d0
  878.             move.w    d0,gng_Width(a3)
  879.  
  880.             move.l    PublicScreen(a4),a0
  881.             moveq.l    #1,d0
  882.             add.b    sc_WBorTop(a0),d0
  883.             lsl.w    #1,d6
  884.             move.w    d0,gng_TopEdge(a3)
  885.  
  886.             move.l    #PLACETEXT_ABOVE,gng_Flags(a3)
  887.  
  888.             move.w    #1,d4
  889.  
  890. CycleLoop        add.w    #1,gng_GadgetID(a3)
  891.             move.l    a2,gng_GadgetText(a3)
  892.  
  893. NextStringEnd2        tst.b    (a2)+
  894.             bne.s    NextStringEnd2
  895.             add.w    d6,gng_TopEdge(a3)
  896.             lea    TemplateArray(a4),a0
  897.             move.w    gng_GadgetID(a3),d0
  898.             lsl.w    #2,d0
  899.             move.l    (a0,d0.w),CycleActive
  900.  
  901.             Push    a2
  902.             moveq.l    #CYCLE_KIND,d0
  903.             move.l    a5,a0        ;Previous
  904.             move.l    a3,a1
  905.             lea    CycleTagList(pc),a2
  906.             CALL    CreateGadgetA
  907.             move.l    d0,a5
  908.             Pull    a2
  909.  
  910.             move.w    RemFontSize(a4),d0
  911.             add.w    d0,gng_TopEdge(a3)
  912.  
  913.             add.l    #5*4,CycleStore
  914.  
  915.             dbf    d4,CycleLoop
  916.  
  917.  
  918.             move.l    #GUI_Text10,gng_GadgetText(a3)
  919.             add.w    #1,gng_GadgetID(a3)
  920.             move.l    #0,gng_Flags(a3)
  921.  
  922.             sub.w    #4,RemEdge(a4)
  923.  
  924.             move.w    RemEdge(a4),gng_TopEdge(a3)
  925.             move.w    RemLen2(a4),gng_Width(a3)
  926.  
  927.             Push    a2
  928.             moveq.l    #BUTTON_KIND,d0
  929.             move.l    a5,a0        ;Previous
  930.             move.l    a3,a1
  931.             lea    TagList(pc),a2
  932.             CALL    CreateGadgetA
  933.             move.l    d0,a5
  934.             Pull    a2
  935.  
  936.             move.l    #GUI_Text11,gng_GadgetText(a3)
  937.             add.w    #1,gng_GadgetID(a3)
  938.  
  939.             move.w    RemEdge(a4),gng_TopEdge(a3)
  940.             move.w    RemLen2(a4),gng_Width(a3)
  941.  
  942.             move.l    StoreInnerWidth,d0
  943.             sub.w    RemLen2(a4),d0
  944.             sub.w    #3,d0
  945.             
  946.             move.w    d0,gng_LeftEdge(a3)
  947.  
  948.             Push    a2
  949.             moveq.l    #BUTTON_KIND,d0
  950.             move.l    a5,a0        ;Previous
  951.             move.l    a3,a1
  952.             lea    TagList(pc),a2
  953.             CALL    CreateGadgetA
  954.             move.l    d0,a5
  955.             Pull    a2
  956.  
  957.             move.l    a5,LastGadget(a4)
  958.  
  959.             sub.l    a0,a0
  960.             lea    WindowTagList(pc),a1
  961.             move.l    IntBase(a4),a6
  962.             CALL    OpenWindowTagList
  963.             move.l    d0,MyWindow(a4)
  964.             beq    FailWindow
  965.  
  966.             move.l    d0,a0
  967.             bsr    EnterSignal
  968.             ;move.l    d0,a0
  969.             move.l    GadgetList(a4),a1
  970.             moveq.l    #-1,d0
  971.             moveq.l    #-1,d1
  972.             sub.l    a2,a2
  973.             CALL    AddGList
  974.  
  975.             move.l    GadgetList(a4),a0
  976.             move.l    MyWindow(a4),a1
  977.             moveq.l    #-1,d0
  978.             sub.l    a2,a2
  979.             CALL    RefreshGList
  980.             
  981.             move.l    GadBase(a4),a6
  982.             move.l    MyWindow(a4),a0
  983.             sub.l    a1,a1
  984.             CALL    GT_RefreshWindow
  985.  
  986.             move.w    #1,GUIOpened(a4)
  987.             RLoad
  988.             rts
  989. OpenNoGUI        move.l    IntBase(a4),a6
  990.             move.l    MyWindow(a4),a0
  991.             CALL    ActivateWindow
  992.             RLoad
  993.             rts
  994.             
  995.  
  996. CheckGUI        RSave
  997.  
  998.             tst.w    GUIOpened(a4)
  999.             beq    NoGUI
  1000.  
  1001.             move.l    GadBase(a4),a6
  1002.             move.l    MyWindow(a4),a0
  1003.             move.l  wd_UserPort(a0),a0
  1004.             CALL    GT_GetIMsg
  1005.             tst.l   d0         
  1006.             beq     NoGUI
  1007.             move.l  d0,a1
  1008.             moveq.l    #0,d6
  1009.             move.w    im_Code(a1),d6    ;Value of Gadget
  1010.             move.l  im_IAddress(a1),a2
  1011.  
  1012.             move.l    im_Class(a1),d7
  1013.             CALL    GT_ReplyIMsg
  1014.  
  1015.             cmp.l    #GADGETUP,d7
  1016.             bne.s    Others
  1017.  
  1018.             move.w    gg_GadgetID(a2),d0
  1019.             cmp.w    #10,d0
  1020.             beq    HideGad
  1021.             cmp.w    #11,d0
  1022.             beq    QuitGad
  1023.  
  1024.             cmp.w    #8,d0
  1025.             bcc.s    OtherGui
  1026.  
  1027.             subq    #1,d0
  1028.             bmi.s    NoGUI
  1029.  
  1030. OtherGui        cmp.w    #10,d0
  1031.             bcc.s    OtherGui
  1032.  
  1033.             lsl.w    #2,d0
  1034.             lea    TemplateArray(a4),a0
  1035.             move.l    d6,(a0,d0.w)
  1036.             bra.s    NoGUI
  1037.  
  1038. QuitGad            bsr    CloseGUI
  1039.             move.w    #1,QuitMe(a4)
  1040.             bra.s    HideGad
  1041.  
  1042. Others                    cmp.l   #CLOSEWINDOW,d7
  1043.                     bne.s    NoGUI
  1044. HideGad            bsr    CloseGUI
  1045. NoGUI            RLoad
  1046.             rts
  1047.  
  1048. CloseGUI        RSave
  1049.             tst.w    GUIOpened(a4)
  1050.             beq.s    NotOpened
  1051.             move.l    IntBase(a4),a6
  1052.             move.l    MyWindow(a4),a0
  1053.             bsr    RemoveSignal
  1054.             ;move.l    MyWindow(a4),a0
  1055.             move.l    GadgetList(a4),a1
  1056.             moveq.l    #-1,d0
  1057.             CALL    RemoveGList
  1058.  
  1059.             move.l    MyWindow(a4),a0
  1060.             CALL    CloseWindow
  1061.             
  1062. FailWindow        move.l    GadgetList(a4),a0
  1063.             move.l    GadBase(a4),a6
  1064.             CALL    FreeGadgets
  1065.  
  1066.             move.l    MyVisual(a4),a0
  1067.             CALL    FreeVisualInfo
  1068.  
  1069.             move.l    IntBase(a4),a6
  1070.             sub.l    a0,a0
  1071.             move.l    PublicScreen(a4),a1
  1072.             CALL    UnlockPubScreen
  1073.  
  1074. NotOpened        clr.w    GUIOpened(a4)
  1075.  
  1076.             RLoad
  1077.             rts
  1078.  
  1079. EnterSignal        Push    d0-d1/a0          
  1080.             move.l  wd_UserPort(a0),a0
  1081.             move.b  MP_SIGBIT(a0),d0  
  1082.             moveq.l #1,d1             
  1083.             lsl.l   d0,d1             
  1084.             or.l    d1,SignalMask(a4) 
  1085.             Pull    d0-d1/a0          
  1086.             rts                       
  1087.                                           
  1088. RemoveSignal        Push    d0-d1/a0          
  1089.             move.l  wd_UserPort(a0),a0
  1090.             move.b  MP_SIGBIT(a0),d0  
  1091.             moveq.l #1,d1             
  1092.             lsl.l   d0,d1             
  1093.             eor.l   #$ffffffff,d1     
  1094.             and.l   d1,SignalMask(a4) 
  1095.             Pull    d0-d1/a0          
  1096.             rts
  1097.  
  1098. GetNexta0        move.b    (a0)+,d0
  1099.             cmp.b    #"=",d0
  1100.             beq.s    GetNexta0
  1101.             cmp.b    #" ",d0
  1102.             beq.s    GetNexta0
  1103.             or.w    #$20,d0
  1104.             rts
  1105.  
  1106. CycleTagList        dc.l    GTCY_Labels
  1107. CycleStore        dc.l    0
  1108.             dc.l    GTCY_Active
  1109. CycleActive        dc.l    0
  1110.             dc.l    TAG_DONE
  1111.  
  1112. GadgetTagList        dc.l    GTCB_Checked
  1113. CheckedPlace        dc.l    0
  1114. TagList            dc.l    TAG_DONE
  1115. WindowTagList        dc.l    WA_InnerWidth
  1116. StoreInnerWidth            dc.l    0
  1117.             dc.l    WA_InnerHeight
  1118. StoreInnerHeight        dc.l    0
  1119.             dc.l    WA_IDCMP
  1120.                 dc.l    BUTTONIDCMP!CLOSEWINDOW
  1121.             dc.l    WA_Flags
  1122.                 dc.l    WINDOWCLOSE!WINDOWDRAG!WINDOWDEPTH!ACTIVATE    
  1123.             dc.l    WA_PubScreen
  1124. StorePublicScreen        dc.l    0
  1125.             dc.l    WA_Title
  1126.                 dc.l    Texth
  1127.             dc.l    WA_AutoAdjust
  1128.                 dc.l    1
  1129.             dc.l    TAG_DONE
  1130. RememberA4        dc.l    0
  1131.  
  1132.             rsreset
  1133.  
  1134. DisplayInfer        rs.b    dim_SIZEOF
  1135. GadgetList        rs.l    1
  1136. What            rs.w    1
  1137. DisableHW        rs.w    1
  1138. GUIOpened        rs.w    1
  1139. QuitMe            rs.w    1
  1140. RemFontSize        rs.w    1
  1141. GadgetInside        rs.w    11
  1142. MyPort            rs.l    1
  1143. MyVisual        rs.l    1
  1144. Broker            rs.l    1
  1145. ScreenMem        rs.b    ScreenMemSize
  1146. IntBase            rs.l    1
  1147. RemLen            rs.w    1
  1148. RemLen2            rs.w    1
  1149. RemEdge            rs.w    1
  1150. GadBase            rs.l    1
  1151. DosBase            rs.l    1
  1152. CommBase        rs.l    1
  1153. IconBase        rs.l    1
  1154. DObject            rs.l    1
  1155. Active            rs.l    1
  1156. FirstSc            rs.l    1
  1157. GraphicsBase        rs.l    1
  1158. PublicScreen        rs.l    1
  1159. PublicRastport        rs.l    1
  1160. Gadget0            rs.l    1
  1161. VisualX            rs.w    1
  1162. VisualY            rs.w    1
  1163. TemplateArray        rs.l    0    ;Do not change order!
  1164. TempMove        rs.l    1
  1165. TempSFront        rs.l    1
  1166. TempWFront        rs.l    1
  1167. TempWBOnly        rs.l    1
  1168. TempPDef        rs.l    1
  1169. TempAlways        rs.l    1
  1170. TempRemWin        rs.l    1
  1171. TempCXPOPUP        rs.l    1
  1172. TempHADJ        rs.l    1
  1173. TempVADJ        rs.l    1
  1174.  
  1175. OwnTask            rs.l    1
  1176. Signal            rs.l    1
  1177. Args            rs.l    1
  1178. WBMessage        rs.l    1
  1179. SignalMask        rs.l    1
  1180. MyWindow        rs.l    1
  1181. LastGadget        rs.l    1
  1182. MyNewGadget        rs.b    gng_SIZEOF
  1183. MyInterrupt        rs.b    IS_SIZE
  1184. AllocLength        rs.w    1
  1185.  
  1186. intuition        dc.b    "intuition.library",0
  1187. DosName            dc.b    "dos.library",0
  1188. GraphicsName        dc.b    "graphics.library",0
  1189. IconName        dc.b    "icon.library",0
  1190. GadName            dc.b    "gadtools.library",0
  1191. CommName        dc.b    "commodities.library",0
  1192.             even
  1193.  
  1194. MyNewBroker        dc.b    NB_VERSION    ;Version
  1195.             dc.b    0        ;Reserve1
  1196.             dc.l    HandlerName    ;Name
  1197.             dc.l    PortName    ;Title
  1198.             dc.l    DescText    ;Description
  1199.             dc.w    NBU_NOTIFY!NBU_UNIQUE        ;Unique
  1200.             dc.w    COF_SHOW_HIDE    ;Flags
  1201.             dc.b    0        ;Pri
  1202.             dc.b    0        ;Reserve2
  1203. BrokerPort        dc.l    0        ;Port
  1204.             dc.w    0        ;ReservedChannel
  1205.  
  1206. CycleList    dc.l    GUI_Choose1.1,GUI_Choose1.2,GUI_Choose1.3,GUI_Choose1.4,0
  1207. CycleList2    dc.l    GUI_Choose2.1,GUI_Choose2.2,GUI_Choose2.3,GUI_Choose2.4,0
  1208.  
  1209. WBTemplate    dc.l    TextMove,TempMove
  1210.         dc.l    TextSFront,TempSFront
  1211.         dc.l    TextWFront,TempWFront
  1212.         dc.l    TextWBOnly,TempWBOnly
  1213.         dc.l    TextPDef,TempPDef
  1214.         dc.l    TextAlways,TempAlways
  1215.         dc.l    TextCXPOPUP,TempCXPOPUP
  1216.         dc.l    TextHADJ,TempHADJ
  1217.         dc.l    TextVADJ,TempVADJ
  1218.         dc.l    TextRemWin,TempRemWin
  1219.         dc.l    0
  1220.  
  1221. TextMove    dc.b    "MOVE",0
  1222. TextSFront    dc.b    "SFRONT",0
  1223. TextWFront    dc.b    "WFRONT",0
  1224. TextWBOnly    dc.b    "WBONLY",0
  1225. TextPDef    dc.b    "DEFPUB",0
  1226. TextAlways    dc.b    "ALWAYS",0
  1227. TextCXPOPUP    dc.b    "CX_POPUP",0
  1228. TextHADJ    dc.b    "HADJ",0
  1229. TextVADJ    dc.b    "VADJ",0
  1230. TextRemWin    dc.b    "REMWIN",0
  1231. Template    dc.b    "MOVE/S,SFRONT/S,WFRONT/S,WBONLY/S,DEFPUB/S,ALWAYS/S,CX_POPUP/S,HADJ/K,VADJ/K,REMWIN/S",0
  1232. PortName    dc.b    "Huntwindows 2.1",0
  1233. HandlerName    dc.b    "Huntwindows",0
  1234. Text1        dc.b    "Error in arguments!",$0a,0
  1235. Text2        dc.b    "Error opening V36+ librarys!",$0a,0
  1236.         dc.b    "$VER: "    ;for version information
  1237. Texth        dc.b    "Huntwindows 2.1 (15.3.93) by Jörg Bublath",0
  1238. DescText    dc.b    "Moves screen to show windows",0
  1239. GUI_Text1    dc.b    "Move Screen",0
  1240. GUI_Text2    dc.b    "ScreenToFront",0
  1241. GUI_Text3    dc.b    "WindowToFront",0
  1242. GUI_Text4    dc.b    "Workbench only",0
  1243. GUI_Text5    dc.b    "Set Default PubScreen",0
  1244. GUI_Text6    dc.b    "Always",0
  1245. GUI_Text7    dc.b    "Remember Window",0
  1246. GUI_Text8    dc.b    "Horizontal Adjustment",0
  1247. GUI_Text9    dc.b    "Vertical Adjustment",0
  1248. GUI_Text10    dc.b    "Hide",0
  1249. GUI_Text11    dc.b    "Quit",0
  1250. GUI_Choose1.1    dc.b    "left",0
  1251. GUI_Choose1.2    dc.b    "right",0
  1252. GUI_Choose1.3    dc.b    "center",0
  1253. GUI_Choose1.4    dc.b    "off",0
  1254. GUI_Choose2.1    dc.b    "top",0
  1255. GUI_Choose2.2    dc.b    "bottom",0
  1256. GUI_Choose2.3    dc.b    "center",0
  1257. GUI_Choose2.4    dc.b    "off",0
  1258.  
  1259.         even
  1260.